package com.cskaoyan.javase.homework.day06.stage2;

/**
 * @description: String作为引用数据类型的独特性
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

public class Demo {
    public static void main(String[] args) {
        //双等号比较的是地址
        String s = "hello";
        String s2 = "hello";
        System.out.println(s == s2);
        System.out.println(s.equals(s2));

        String s3 = new String("hello");
        System.out.println(s2 == s3);
        System.out.println(s3.equals(s2));

        System.out.println(s2.equals(s3));
    }
}
